<div class="cil__detail-rest-info--label">
  {{'BIZ.ACQUIRER.OTHER.CURRENCY_CONVERSION' | i18n}}
</div>
<div *ngIf="data.exchangeRates && data.exchangeRates.length > 0">
  <div
    class="mb-sm"
    *ngFor="let column of columns[fields.Currency]; let rowIndex = index"
  >
    <app-info-row
      class="mb-sm"
      [columns]="column"
      [rowIndex]="rowIndex"
      [ifEdit]="isEdits[fields.Currency][rowIndex]"
      (active)="activeItem($event, rowIndex)"
    ></app-info-row>
  </div>
</div>
<div class="cil__no-exchange" *ngIf="!data.exchangeRates">
  <p style="text-align: center">{{'BIZ.ACQUIRER.OTHER.NO_CURRENCY_CONVERSION' | i18n}}</p>
  <button nz-button (click)="goEditTrade()">{{'BTN.ADD' | i18n}}</button>
</div>

<div class="cil__detail-rest-info--label">{{'BIZ.ACQUIRER.OTHER.SECRET_KEY_CONFIG' | i18n}}</div>
<app-info-row
  *ngFor="let column of columns[fields.Institution]; let rowIndex = index"
  [columns]="column"
  [rowIndex]="rowIndex"
  [ifEdit]="isEdits[fields.Institution][rowIndex]"
  (active)="activeItem($event, rowIndex)"
></app-info-row>

<div class="cil__detail-rest-info--label">{{'BIZ.ACQUIRER.OTHER.MERCHANT_FEATURE_CONFIG' | i18n}}</div>
<app-info-row
  *ngFor="let column of columns[fields.MerchantFunc]; let rowIndex = index"
  [columns]="column"
  [rowIndex]="rowIndex"
  [ifEdit]="isEdits[fields.MerchantFunc][rowIndex]"
  (active)="activeItem($event, rowIndex)"
></app-info-row>

<div class="cil__scroll-div"></div>

<ng-template #tpMultiCurrSupport let-column="column">
  <nz-switch [nzDisabled]="column.value" [ngModel]="column.value" (ngModelChange)="switchMultiCurrSupport($event)"></nz-switch>
</ng-template>

<ng-template #tpIsSupportRisk let-column="column">
  <nz-switch [nzDisabled]="column.value" [ngModel]="column.value" (ngModelChange)="switchIsSupportRisk($event)"></nz-switch>
</ng-template>

<ng-template #tpIsSupportPostRisk let-column="column">
  <nz-switch [nzDisabled]="column.value" [ngModel]="column.value" (ngModelChange)="switchIsSupportPostRisk($event)"></nz-switch>
</ng-template>

<ng-template #curOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.Currency][rowIndex]"
    (edit)="goEditTrade()"
    (submit)="submit()">
  </app-rest-edit>
</ng-template>

<ng-template #insOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.Institution][rowIndex]"
    (edit)="goEditTrade()"
    (cancel)="cancel()"
    (submit)="submit()"
  ></app-rest-edit>
</ng-template>

<ng-template #merOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.MerchantFunc][rowIndex]"
    (edit)="edit(fields.MerchantFunc, rowIndex)"
    (cancel)="cancel()"
    (submit)="submit()"
  ></app-rest-edit>
</ng-template>
